function xCOMAngleFn = COMAngleFn(x)
xCOMAngleFn = atan((12759122123*sin(x(1)) + 14065902578*sin(x(1) + x(2)) -  ...
    1637194622*sin(x(1) + x(2) + x(3)) -  ...
    457593477*sin(x(1) + x(2) + x(3) - x(4)))/(-12759122123*cos(x(1)) -  ...
    14065902578*cos(x(1) + x(2)) + 1637194622*cos(x(1) + x(2) + x(3)) +  ...
    457593477*cos(x(1) + x(2) + x(3) - x(4)))) -  ...
 atan(((-1903*sin(x(1)))/5000 - (2261*sin(x(1) + x(2)))/5000 +  ...
    (2261*sin(x(1) + x(2) + x(3)))/5000 +  ...
    (12759122123*sin(x(1)) + 14065902578*sin(x(1) + x(2)) -  ...
      1637194622*sin(x(1) + x(2) + x(3)) -  ...
      457593477*sin(x(1) + x(2) + x(3) - x(4)))/34726000000 +  ...
    (1903*sin(x(1) + x(2) + x(3) - x(4)))/5000)/((1903*cos(x(1)))/5000 +  ...
    (2261*cos(x(1) + x(2)))/5000 - (2261*cos(x(1) + x(2) + x(3)))/5000 -  ...
    (1903*cos(x(1) + x(2) + x(3) - x(4)))/5000 +  ...
    (-12759122123*cos(x(1)) - 14065902578*cos(x(1) + x(2)) +  ...
      1637194622*cos(x(1) + x(2) + x(3)) +  ...
      457593477*cos(x(1) + x(2) + x(3) - x(4)))/34726000000)) ...
;